package com.ky.gp.app.controller;


import com.ky.common.param.ProblemAdd;
import com.ky.common.vo.R;
import com.ky.gp.app.service.ProblemFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * <p>
 * 问题表 前端控制器
 * </p>
 *
 * @author lcr
 * @since 2024-06-20
 */
@RestController
@RequestMapping("/api/circle/problem")
public class ProblemController {



    @Autowired
    private ProblemFeign problemFeign;

    @RequestMapping("/selectProblemList")
    public R selectProblemList() {
        return problemFeign.selectProblemList();

    }


    @RequestMapping("/selectProblemById/{id}")
    public R selectProblemById(@PathVariable Integer id) {
        return problemFeign.selectProblemById(id);

    }



    @RequestMapping("/addProblem")
    public R addProblem(@RequestBody ProblemAdd problemAdd) {
        return problemFeign.addProblem(problemAdd);

    }



    @RequestMapping("/addFollowers/{id}")
    public R addFollowers(@PathVariable int id){
        return problemFeign.addFollowers(id);

    }



    @RequestMapping("/commentsCount/{id}/commentsCount")
    public R commentCount(@PathVariable int id){
        return problemFeign.commentCount(id);
    }



    @RequestMapping("/follow/{id}/follow")
    public R selectFollow(@PathVariable int id){
        return problemFeign.selectFollow(id);

    }




}

